#pragma once

#include <string>
#include <vector>

using namespace std;
class TreeNode;
// A CFG node consists of:
// 1. The Line Number
// 2. A Link to the corresponding AST TreeNode
// 3. A Link to its predecessors
// 4. A Link to its successors 
class CFGNode {
	private:
		int mContent;
		vector<CFGNode*> mPredecessorsList;
		vector<CFGNode*> mSuccessorsList;
		TreeNode* mASTNodeLink;

    public:
		//Resevered for CFG End Node use.
		CFGNode(void);
		//For normal CFG Node
		CFGNode(int, TreeNode*);
		~CFGNode(void);

		//For rare cases.
		//In general, setASTNodeLink is done in the constructor
		virtual bool setASTNodeLink(TreeNode*);
		virtual TreeNode* getASTNodeLink();

		virtual void setContent(int);
		virtual int getContent();

		virtual void addSuccessor(CFGNode*);
		virtual void addPredecessor(CFGNode*);
		virtual vector<CFGNode*> getSuccessor();
		virtual int getNumberOfSuccessor();
		virtual vector<CFGNode*> getPredecessor();
		virtual int getNumberOfPredecessor();
};

